package cn.ac.iscas.utils;

import java.util.regex.Pattern;

public class DataSongRegexUtils {
    public static boolean checkIP(final String ip){
        Pattern ipPattern = Pattern.compile("^(([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.){3}([01]?\\d\\d?|2[0-4]\\d|25[0-5])$");
        return ipPattern.matcher(ip).matches();
    }

    public static void main(String[] args){
        System.out.println(DataSongRegexUtils.checkIP("127.0.0.1"));
    }
}
